import request from '@/utils/request';

/**
 * 查询数字员工列表
 *  /dataStaff/list
 */
export async function queryEmployeeList(data: API.requestPageParams, options?: API.baseOption) {
  return request<API.VirtualEmployee[]>('/dataStaff/list', {
    method: 'GET',
    data,
    ...(options || {}),
  });
}

/**
 * 获取数字员工详情
 */
export async function querEmployeeDetail(data: Record<'id', string>, options?: API.baseOption) {
  return request<API.VirtualEmployeeDetail>(`/dataStaff/${data.id}/detail`, {
    method: 'GET',
    ...(options || {}),
  });
}

/**
 * 新增或者修改数字员工信息
 */
export async function saveOrUpdateEmployee(data: API.UserDetailParams, options?: API.baseOption) {
  return request<string>('/dataStaff/save', {
    method: 'POST',
    data,
    ...(options || {}),
  });
}

/**
 * 数字员工关联知识库
 */
export async function relateKnowledge(data: API.paramsT, options?: API.baseOption) {
  return request<string>('/dataStaff/saveRange', {
    method: 'POST',
    data,
    ...(options || {}),
  });
}

/**
 * 查询对话模型列表
 *  /dataStaff/list
 */
export async function queryChatModalList(options?: API.baseOption) {
  return request<API.PageUserList>('/llm/list', {
    method: 'GET',
    ...(options || {}),
  });
}

/**
 * 查询知识库列表
 *  /dataStaff/list
 */
export async function queryKnowledgeList(options?: API.baseOption) {
  return request<API.PageUserList>('/knowledge/listWithPrivilege', {
    method: 'GET',
    ...(options || {}),
  });
}

/**
 * 数字员工上下架
 */
export async function statusToggle(data: any, options?: API.baseOption) {
  return request<string>('/dataStaff/statusToggle', {
    method: 'POST',
    data,
    ...(options || {}),
  });
}

/**
 * 查询可选用户列表
 *  /user/getListExcludeOwner
 */
export async function queryListExcludeOwner(
  data: API.requestManagerList,
  options?: API.baseOption,
) {
  return request<any>('/user/getListExcludeOwner', {
    method: 'GET',
    data,
    ...(options || {}),
  });
}
